package a.e.b.a;

import a.c.e;
import a.c.q;
import a.e.a.x;
import a.e.b.b.a;
import a.e.b.b.cb;
import a.e.b.b.t;
import a.f.yc;
import a.j.a.h;
import a.j.g;
import a.j.*;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

import java.util.HashMap;
import java.util.Map;

public class bb
  implements a.e.b.b.n
{
  static final Map a = new HashMap();
  static final Map b = x.i;
  static Class c;
  static Class d;
  public static int e;
  
  protected void a(t paramt, Node paramNode, jg paramjg)
    throws a
  {
    y.a(paramNode, paramjg, new b_(null), paramt);
    d(paramt, paramNode, paramjg);
    c(paramt, paramNode, paramjg);
    NamedNodeMap localNamedNodeMap = paramNode.getAttributes();
    Node localNode = localNamedNodeMap.getNamedItem("borderDistance");
    if (localNode != null) {
      paramjg.f(Double.parseDouble(localNode.getNodeValue()));
    }
  }
  
  private void c(t paramt, Node paramNode, jg paramjg)
  {
    if ((i.i) || (paramjg.D() == 4))
    {
      ld localld = paramjg.hb();
      if (localld != null)
      {
        a.d.o localo = y.a(paramNode, localld.a(), localld.b());
        if (localo != null) {
          paramjg.a(paramjg.a().a(localo, localld));
        }
      }
    }
  }
  
  protected void d(t paramt, Node paramNode, jg paramjg)
    throws a
  {
    boolean bool = i.i;
    NamedNodeMap localNamedNodeMap = paramNode.getAttributes();
    Node localNode1 = localNamedNodeMap.getNamedItem("modelName");
    if ((bool) || (localNode1 != null))
    {
      String str = localNode1.getNodeValue();
      if (!bool) {
        if ("custom".equals(str))
        {
          localObject1 = a.e.b.b.bb.a(paramNode, "LabelModel", "http://www.yworks.com/xml/graphml");
          Object localObject2 = null;
          if ((bool) || (localObject1 != null)) {
            localObject2 = paramt.a(a.e.b.b.bb.a((Node)localObject1));
          }
          Node localNode2 = a.e.b.b.bb.a(paramNode, "ModelParameter", "http://www.yworks.com/xml/graphml");
          Object localObject3 = null;
          if ((bool) || (localNode2 != null)) {
            localObject3 = paramt.a(a.e.b.b.bb.a(localNode2));
          }
          if (!bool)
          {
            if (!(localObject2 instanceof yc)) {
              return;
            }
            paramjg.a((yc)localObject2, localObject3);
          }
          if (bool) {
            break label187;
          }
          if (i.h == 0) {
            return;
          }
        }
      }
      Object localObject1 = b.get(str);
      if (!bool)
      {
        if ((localObject1 instanceof Byte))
        {
          label187:
          byte b1 = ((Byte)localObject1).byteValue();
          paramjg.e(b1);
        }
        localNode1 = localNamedNodeMap.getNamedItem("modelPosition");
      }
      if (!bool)
      {
        if (localNode1 != null) {
          localObject1 = a.get(localNode1.getNodeValue());
        }
      }
      else if ((localObject1 instanceof Byte)) {
        paramjg.d(((Byte)localObject1).byteValue());
      }
    }
  }
  
  protected jg a(t paramt, Node paramNode)
  {
    boolean bool = i.i;
    Object localObject1 = paramt.b();
    q localq = paramt.d();
    if ((bool) || (((localObject1 instanceof e)) && ((bool) || ((localq instanceof g)))))
    {
      Object localObject2 = paramt.a(i.b);
      if ((bool) || ((localObject2 instanceof ld)))
      {
        ld localld = (ld)localObject2;
        jg localjg = localld.v();
        if (!bool)
        {
          if (a(localld))
          {
            if (bool) {
              break label118;
            }
            if (localld.x() == 0) {
              localjg.f(0.0D);
            }
          }
          label118:
          localld.b(localjg);
        }
        return localjg;
      }
    }
    return new jg();
  }
  
  private boolean a(ld paramld)
  {
    boolean bool = i.i;
    if (!bool) {
      if ((paramld instanceof a.j.a.o)) {
        return true;
      }
    }
    if (!bool) {
      if ((paramld instanceof a.j.a.n))
      {
        a.j.a.n localn = (a.j.a.n)paramld;
        if (!bool) {}
        Object localObject = md.e().a(localn.g(), c == null ? (bb.c = a("a.j.md$t_")) : c);
        return localObject instanceof h;
      }
    }
    return false;
  }
  
  public void a(cb paramcb)
    throws a
  {
    boolean bool = i.i;
    Node localNode = paramcb.e();
    if (((bool) || (localNode.getNodeType() == 1)) && ((bool) || (("NodeLabel".equals(localNode.getLocalName())) && ("http://www.yworks.com/xml/graphml".equals(localNode.getNamespaceURI())))))
    {
      jg localjg = a(paramcb.d(), localNode);
      a(paramcb.d(), localNode, localjg);
      paramcb.a(localjg);
    }
  }
  
  static Class a(String paramString)
  {
    try
    {
      return Class.forName(paramString);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
  
  static
  {
    a.put("n", new Byte((byte)108));
    a.put("nw", new Byte((byte)104));
    a.put("ne", new Byte((byte)105));
    a.put("w", new Byte((byte)111));
    a.put("e", new Byte((byte)110));
    a.put("sw", new Byte((byte)107));
    a.put("s", new Byte((byte)109));
    a.put("se", new Byte((byte)106));
    a.put("c", new Byte((byte)100));
    a.put("t", new Byte((byte)102));
    a.put("tl", new Byte((byte)117));
    a.put("tr", new Byte((byte)118));
    a.put("r", new Byte((byte)116));
    a.put("l", new Byte((byte)115));
    a.put("bl", new Byte((byte)119));
    a.put("b", new Byte((byte)101));
    a.put("br", new Byte((byte)120));
    a.put("anywhere", new Byte((byte)114));
    a.put("dynamic", new Byte((byte)112));
  }
  
  private static final class b_
    implements y.a_
  {
    private b_() {}
    
    public boolean a(hg paramhg, Node paramNode, t paramt)
    {
      boolean bool = i.i;
      jg localjg = (jg)paramhg;
      if (!bool) {}
      bb.c_ localc_ = (bb.c_)paramt.a(bb.d == null ? (bb.d = bb.a("a.e.b.a.bb$c_")) : bb.d);
      if ((bool) || (localc_ != null))
      {
        localc_.a(localjg, paramNode, paramt);
        return true;
      }
      return false;
    }
    
    b_(bb.0 param0)
    {
      this();
    }
  }
  
  public static class d_
    implements a.e.b.b.n
  {
    public static boolean a;
    
    public void a(cb paramcb)
      throws a
    {
      boolean bool = i.i;
      Node localNode = paramcb.e();
      if ((bool) || ((localNode.getNodeType() == 1) && ((bool) || ("http://www.yworks.com/xml/graphml".equals(localNode.getNamespaceURI())))))
      {
        String str = localNode.getLocalName();
        if (!bool) {
          if ("SmartNodeLabelModel".equals(str)) {
            paramcb.a(b(localNode, paramcb.d()));
          }
        }
        if ((bool) || ((i.h != 0) && ("SmartNodeLabelModelParameter".equals(str)))) {
          paramcb.a(a(localNode, paramcb.d()));
        }
      }
    }
    
    protected Object a(Node paramNode, t paramt)
    {
      boolean bool = i.i;
      NamedNodeMap localNamedNodeMap = paramNode.getAttributes();
      Node localNode = localNamedNodeMap.getNamedItem("nodeRatioX");
      double d1 = 0.0D;
      if (!bool) {
        if (localNode != null) {
          try
          {
            d1 = Double.parseDouble(localNode.getNodeValue());
          }
          catch (NumberFormatException localNumberFormatException1)
          {
            d1 = 0.0D;
          }
        }
      }
      localNode = localNamedNodeMap.getNamedItem("nodeRatioY");
      double d2 = 0.0D;
      if (!bool) {
        if (localNode != null) {
          try
          {
            d2 = Double.parseDouble(localNode.getNodeValue());
          }
          catch (NumberFormatException localNumberFormatException2)
          {
            d2 = 0.0D;
          }
        }
      }
      localNode = localNamedNodeMap.getNamedItem("labelRatioX");
      double d3 = 0.0D;
      if (!bool) {
        if (localNode != null) {
          try
          {
            d3 = Double.parseDouble(localNode.getNodeValue());
          }
          catch (NumberFormatException localNumberFormatException3)
          {
            d3 = 0.0D;
          }
        }
      }
      localNode = localNamedNodeMap.getNamedItem("labelRatioY");
      double d4 = 0.0D;
      if (!bool) {
        if (localNode != null) {
          try
          {
            d4 = Double.parseDouble(localNode.getNodeValue());
          }
          catch (NumberFormatException localNumberFormatException4)
          {
            d4 = 0.0D;
          }
        }
      }
      localNode = localNamedNodeMap.getNamedItem("offsetX");
      double d5 = 0.0D;
      if (!bool) {
        if (localNode != null) {
          try
          {
            d5 = Double.parseDouble(localNode.getNodeValue());
          }
          catch (NumberFormatException localNumberFormatException5)
          {
            d5 = 0.0D;
          }
        }
      }
      localNode = localNamedNodeMap.getNamedItem("offsetY");
      double d6 = 0.0D;
      if (!bool) {
        if (localNode != null) {
          try
          {
            d6 = Double.parseDouble(localNode.getNodeValue());
          }
          catch (NumberFormatException localNumberFormatException6)
          {
            d6 = 0.0D;
          }
        }
      }
      localNode = localNamedNodeMap.getNamedItem("upX");
      double d7 = 0.0D;
      if (!bool) {
        if (localNode != null) {
          try
          {
            d7 = Double.parseDouble(localNode.getNodeValue());
          }
          catch (NumberFormatException localNumberFormatException7)
          {
            d7 = 0.0D;
          }
        }
      }
      localNode = localNamedNodeMap.getNamedItem("upY");
      double d8 = -1.0D;
      if ((bool) || (localNode != null)) {
        try
        {
          d8 = Double.parseDouble(localNode.getNodeValue());
        }
        catch (NumberFormatException localNumberFormatException8)
        {
          d8 = -1.0D;
        }
      }
      return new se.a_(d1, d2, d3, d4, d5, d6, d7, d8);
    }
    
    protected Object b(Node paramNode, t paramt)
    {
      NamedNodeMap localNamedNodeMap = paramNode.getAttributes();
      Node localNode = localNamedNodeMap.getNamedItem("distance");
      double d = 0.0D;
      if ((i.i) || (localNode != null)) {
        try
        {
          d = Double.parseDouble(localNode.getNodeValue());
        }
        catch (NumberFormatException localNumberFormatException)
        {
          d = 0.0D;
        }
      }
      return new se(d);
    }
  }
  
  public static abstract interface c_
  {
    public abstract void a(jg paramjg, Node paramNode, t paramt);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.b.a.bb

 * JD-Core Version:    0.7.0.1

 */